
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1">
    <form action="listName" method="GET">
        <select name="id">
            <option value="0">--全部--</option>
            <option value="1">全面解析Java XML技术</option>
            <option value="2">经典java入门教程更新</option>
            <option value="3">JavaScript学习笔记</option>
        </select>
        <input type="submit" value="查询">
    </form>
    <a href="INSERT.jsp">新增电子文档</a>
    <tr>
        <h1>电子文档列表</h1>
        <td>文档编号</td>
        <td>文档名称</td>
        <td>文档摘要</td>
        <td>上传人</td>
        <td>上传时间</td>
        <td>操作</td>

    </tr>
    <c:forEach items="${list}" var="card">
        <tr>
            <td>${card.id}</td>
            <td>${card.title}</td>
            <td>${card.summray}</td>
            <td>${card.uploaduser}</td>
            <td>${card.createdate}</td>
            <td>
                <a href="findById?id=${card.id}">修改</a>
                <a href="javascript:void (0)" onclick="del(${card.id})">删除</a>

        </tr>
    </c:forEach>

</table>

<script src="js/jquery.js"></script>
<script>
    function del(id){
        if(!confirm('确定要删除嘛')){
            return;
        }
        $.post('delete',{id:id},function (data){
            alert("删除成功");
            location.reload();
        })
    }
</script>
<div>
    <a href="list?currPage=1&pageSize=${pageSize}">首页</a>
    &nbsp;  &nbsp;  &nbsp;  &nbsp;
    <a href="list?currPage=${currPage-1}&pageSize=${pageSize}">上一页</a>
    &nbsp;  &nbsp;  &nbsp;  &nbsp;
    <a href="list?currPage=${currPage+1}&pageSize=${pageSize}">下一页</a>
    &nbsp;  &nbsp;  &nbsp;  &nbsp;
    <a href="list?currPage=${totalPage}&pageSize=${pageSize}">末页</a>
    &nbsp;  &nbsp;  &nbsp;  &nbsp;
<%--    总页数：--%>
    ${currPage}/${totalPage}
    &nbsp;  &nbsp;  &nbsp;  &nbsp;
    总记录数：${totalCount}

</div>
</body>
</html>
